package com.itheima.cases.date_time_format;

import java.time.Duration;
import java.time.LocalDateTime;

public class Test2 {
    public static void main(String[] args) {
        // 时间间隔计算

        LocalDateTime past = LocalDateTime.of(2012, 12, 12, 0, 0, 0);

        LocalDateTime now = LocalDateTime.now();

        Duration between = Duration.between(past, now);

        System.out.println("间隔" + between.toDays() + "天");
        System.out.println("间隔" + between.toHours() + "小时");
        System.out.println("间隔" + between.toMinutes()+ "分钟");
    }
}
